chore(lint): enable clippy::unnecessary_wraps#161
Open
tupe12334 wants to merge 1 commit into
Open
Conversation
Promote clippy::unnecessary_wraps to deny in core/Cargo.toml, continuing the incremental lint-ratcheting policy. The lint surfaced one violation: run_validate returned io::Result<bool> but never returned Err. Change it to return plain bool, simplify the validate command call site, and drop the now-unnecessary .unwrap() from the related tests. Closes #160 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enables the
clippy::unnecessary_wrapslint (deny) incore/Cargo.toml, continuing the project's incremental lint-ratcheting policy.Why
clippy::unnecessary_wrapsflags functions that always returnOk(...)/Some(...)and neverErr/None, while still declaring aResult/Optionreturn type. Such signatures are dishonest and push needless error-handling boilerplate onto every caller.Changes
core/Cargo.toml— addunnecessary_wraps = "deny"to[lints.clippy].core/src/bin/main.rs— the lint surfaced one real violation:run_validate()returnedio::Result<bool>but never returnedErr(no fallible I/O —validate_checklistsreturns aVecof errors, not aResult). Changed it to return plainbool:validatecommand call site (match Ok/Err→if !run_validate(...)),.unwrap()from the related tests,Verification
cargo clippy --all-targets— clean.cargo test— all 146 tests pass.Closes #160
This pull request was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim.